{"ast":null,"code":"import * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DEFAULT_MODE_STORAGE_KEY = 'mode';\nexport const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';\nexport const DEFAULT_ATTRIBUTE = 'data-color-scheme';\nexport default function getInitColorSchemeScript(options) {\n  const {\n    defaultMode = 'light',\n    defaultLightColorScheme = 'light',\n    defaultDarkColorScheme = 'dark',\n    modeStorageKey = DEFAULT_MODE_STORAGE_KEY,\n    colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n    attribute = DEFAULT_ATTRIBUTE,\n    colorSchemeNode = 'document.documentElement'\n  } = options || {};\n  return /*#__PURE__*/_jsx(\"script\", {\n    // eslint-disable-next-line react/no-danger\n    dangerouslySetInnerHTML: {\n      __html: `(function() { try {\n        var mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';\n        var cssColorScheme = mode;\n        var colorScheme = '';\n        if (mode === 'system') {\n          // handle system mode\n          var mql = window.matchMedia('(prefers-color-scheme: dark)');\n          if (mql.matches) {\n            cssColorScheme = 'dark';\n            colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n          } else {\n            cssColorScheme = 'light';\n            colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n          }\n        }\n        if (mode === 'light') {\n          colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n        }\n        if (mode === 'dark') {\n          colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n        }\n        if (colorScheme) {\n          ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);\n        }\n      } catch (e) {} })();`\n    }\n  });\n}","map":{"version":3,"names":["React","jsx","_jsx","DEFAULT_MODE_STORAGE_KEY","DEFAULT_COLOR_SCHEME_STORAGE_KEY","DEFAULT_ATTRIBUTE","getInitColorSchemeScript","options","defaultMode","defaultLightColorScheme","defaultDarkColorScheme","modeStorageKey","colorSchemeStorageKey","attribute","colorSchemeNode","dangerouslySetInnerHTML","__html"],"sources":["/data/messenger.client/node_modules/@mui/system/esm/cssVars/getInitColorSchemeScript.js"],"sourcesContent":["import * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DEFAULT_MODE_STORAGE_KEY = 'mode';\nexport const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';\nexport const DEFAULT_ATTRIBUTE = 'data-color-scheme';\nexport default function getInitColorSchemeScript(options) {\n  const {\n    defaultMode = 'light',\n    defaultLightColorScheme = 'light',\n    defaultDarkColorScheme = 'dark',\n    modeStorageKey = DEFAULT_MODE_STORAGE_KEY,\n    colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n    attribute = DEFAULT_ATTRIBUTE,\n    colorSchemeNode = 'document.documentElement'\n  } = options || {};\n  return /*#__PURE__*/_jsx(\"script\", {\n    // eslint-disable-next-line react/no-danger\n    dangerouslySetInnerHTML: {\n      __html: `(function() { try {\n        var mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';\n        var cssColorScheme = mode;\n        var colorScheme = '';\n        if (mode === 'system') {\n          // handle system mode\n          var mql = window.matchMedia('(prefers-color-scheme: dark)');\n          if (mql.matches) {\n            cssColorScheme = 'dark';\n            colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n          } else {\n            cssColorScheme = 'light';\n            colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n          }\n        }\n        if (mode === 'light') {\n          colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n        }\n        if (mode === 'dark') {\n          colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n        }\n        if (colorScheme) {\n          ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);\n        }\n      } catch (e) {} })();`\n    }\n  });\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,OAAO,MAAMC,wBAAwB,GAAG,MAAM;AAC9C,OAAO,MAAMC,gCAAgC,GAAG,cAAc;AAC9D,OAAO,MAAMC,iBAAiB,GAAG,mBAAmB;AACpD,eAAe,SAASC,wBAAwB,CAACC,OAAO,EAAE;EACxD,MAAM;IACJC,WAAW,GAAG,OAAO;IACrBC,uBAAuB,GAAG,OAAO;IACjCC,sBAAsB,GAAG,MAAM;IAC/BC,cAAc,GAAGR,wBAAwB;IACzCS,qBAAqB,GAAGR,gCAAgC;IACxDS,SAAS,GAAGR,iBAAiB;IAC7BS,eAAe,GAAG;EACpB,CAAC,GAAGP,OAAO,IAAI,CAAC,CAAC;EACjB,OAAO,aAAaL,IAAI,CAAC,QAAQ,EAAE;IACjC;IACAa,uBAAuB,EAAE;MACvBC,MAAM,EAAG;AACf,2CAA2CL,cAAe,UAASH,WAAY;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkDI,qBAAsB,eAAcF,sBAAuB;AAC7G;AACA;AACA,kDAAkDE,qBAAsB,gBAAeH,uBAAwB;AAC/G;AACA;AACA;AACA,gDAAgDG,qBAAsB,gBAAeH,uBAAwB;AAC7G;AACA;AACA,gDAAgDG,qBAAsB,eAAcF,sBAAuB;AAC3G;AACA;AACA,YAAYI,eAAgB,kBAAiBD,SAAU;AACvD;AACA;IACI;EACF,CAAC,CAAC;AACJ"},"metadata":{},"sourceType":"module"}